/*
* Copyright (C) 2008-2009 J-P Nurmi jpnurmi@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* $Id: settings.h 546 2009-05-15 04:32:55Z jpnurmi $
*/

#ifndef SETTINGS_H
#define SETTINGS_H

#include <QMap>
#include <QHash>
#include <QFont>
#include <QVariant>
#include <QMetaType>

struct Settings
{
    Settings();
    operator QVariant() const;
    bool operator==(const Settings& other) const;
    bool operator!=(const Settings& other) const;

    enum MessageType
    {
        Joins,
        Parts,
        Nicks,
        Modes,
        Kicks,
        Quits,
        Topics
    };

    enum ColorType
    {
        Background,
        Message,
        Event,
        Notice,
        Action,
        Highlight
    };

    QHash<int, bool> messages;
    QHash<int, bool> highlights;
    QHash<int, QString> colors;
    QMap<QString, QString> aliases;
    QString language;
    QFont font;
};
Q_DECLARE_METATYPE(Settings);

inline QDataStream& operator<<(QDataStream& out, const Settings& settings)
{
    out << settings.messages;
    out << settings.highlights;
    out << settings.aliases;
    out << settings.language;
    out << settings.font;
    out << settings.colors;
    return out;
}

inline QDataStream& operator>>(QDataStream& in, Settings& settings)
{
    in >> settings.messages;
    in >> settings.highlights;
    in >> settings.aliases;
    in >> settings.language;
    in >> settings.font;
    in >> settings.colors;
    return in;
}

#endif // SETTINGS_H
